<template>
    <div>
        <slot name="title"></slot>
        <div ref="echartsChart" :style="{ width: '100%', height: '17vw' }"></div>
    </div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import * as echarts from 'echarts';
import { useEchartsStore } from '../../stores/counter.ts'

const echartsChart = ref(null);
const echartsStore = useEchartsStore()

onMounted(() => {
    // 在组件挂载后初始化Echarts图表
    const chartInstance = echarts.init(echartsChart.value);

    // 使用配置项和数据绘制图表
    chartInstance.setOption(echartsStore.orderOption);
});
</script>
<style lang="">
    
</style>